package org.meb.speedway.bean;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Inject;
import javax.persistence.EntityManager;

import org.meb.speedway.config.SpeedwayDatabase;
import org.meb.speedway.model.common.ProcessLog;

@Stateless
public class LogServiceBean implements LogService {

	@Inject
	@SpeedwayDatabase
	private EntityManager em;

	@Override
	@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
	public void persistProcessLog(ProcessLog processLog) {
		em.persist(processLog);
		em.flush();
	}
}
